var express = require('express');
var router = express.Router();
let controller = require('../Controller/categoryController');


router.use(function (req, res, next) {
    controller.res = res;
    next()
});

router.get('/', function (req, res, next) {
    res.send("111111");
});

router.post('/add', function (req, res, next) {
    let body = req.body;
    console.log(JSON.stringify(body));
    controller.addCategory(body);
});

router.post('/update', function (req, res, next) {

});

router.post('/del', function (req, res, next) {

});

router.get('/list', function (req, res, next) {
    controller.getCategoryList(req.query);
});

module.exports = router;